<template>
  <section class="h100 keFu-panel">
    <van-row class="header-panel" v-if="this.showTitle">
      {{ title }}
      <div class="arrow" @click="toHome()">
        <van-icon name="arrow-left"/>
      </div>
    </van-row>
    <van-row class="panel-content">
      <div v-html="contractData"></div>
    </van-row>
  </section>
</template>

<script>
export default {
  data() {
    return {
      title: "",
      showTitle: 0,
      contractData: "",
    }
  },
  created() {
    this.getLoad();
  },
  methods: {
    //初始化加载
    getLoad() {
      this.id = this.$route.query.id;
      this.appId = this.$route.query.appId;
      this.gameId = this.$route.query.gameId;
      this.type = this.$route.query.type;
      this.title = this.$route.query.title;
      this.showTitle = this.$route.query.showTitle;
      let params = {
        id: this.id ? this.id : 0,
        appId: this.appId ? this.appId : "",
        gameId: this.gameId ? this.gameId : 0,
        type: this.type ? this.type : "",
      }
      this.$http(window.config.webHomeApiV2 + '/contract/info', params).then((res) => {
        let code = res['code'];
        if (code !== 1) {
          this.BRDialog(res['msg']);
          return;
        }
        let resData = res['data'];
        this.contractData = resData['details'];
      });
    },
    //返回首页
    toHome() {
      this.$router.push('/account/home');
    }
  }
};
</script>

<style lang='less'>
@import "../../assets/css/keFu/index.less";
</style>